-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Lower array repeat and scan ops #1717
Conversation
/// the array. I.e. it is of type `array.get_element_type().ptr_type()` not | ||
/// `array.ptr_type()` | ||
fn with_array_alloca<'c, T, E: From<BuilderError>>( | ||
/// Returns two pointers: The first one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment looks unfinished
#[case(5, 42, 2)] | ||
#[case(5, 42, 3)] | ||
#[case(5, 42, 4)] | ||
fn exec_repeat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a very satisfying test -- it'd be nicer to have something where the function inspects the inputs and puts a different value in each location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not possible with repeat, all values in the array must have the same value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, I was thinking repeat was haskell's Data.List.iterate
// We build a HUGR that: | ||
// - Creates an array [1, 2, 3, ..., size] | ||
// - Maps a function that increments each element by `inc` | ||
// - Returns the sum of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the what?? 😛
Closes #1681